package com.lhy.dao;

import com.lhy.domain.Member;
import com.lhy.utils.Pagination;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 汪
 */
@Repository
public interface MemberDao {
    /**
     * 查询所有
     * @return
     */
    List<Member> showAllMember();

    /**
     * 添加member
     * @param member
     * @return
     */
    int addMember(Member member);

    /**
     * 精确查找
     * @param id
     * @return
     */
    Member getOneMemberByUserId(Integer id);

    /**
     * 获取userId
     * @param memberId
     * @return
     */
    Integer getUserId(Integer memberId);

    /**
     * 修改
     * @param member
     * @return
     */
    int modifyMember(Member member);

    /**
     * 删除
     * @param memberId
     * @return
     */
    int deleteMember(Integer memberId);

    /**
     * 充值
     * @param
     */
    void modifyMount(@Param("money") Double money, @Param("memberId") Integer memberId);

    /**
     * 查找
     * @param memberId
     * @return
     */
    Member getOneMemberByMemberId(Integer memberId);

    /**
     * 查询
     * @param memberId
     * @param realName
     * @param tel
     * @param credit
     * @return
     */
    List<Member> showSomeMember(Pagination<Member> page);
}
